package com.hospital.hospitalsystem.modules.hospital.service;

import com.hospital.hospitalsystem.modules.hospital.dao.entity.DepartmentEntity;
import com.hospital.hospitalsystem.modules.hospital.dao.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author qiancheng@cqxyy.net
 * @date 2023/2/22
 */
@Component
public class DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    public List<DepartmentEntity> selectByExample(Example example){
        return departmentMapper.selectByExample(example);
    }

    public void insertSelective(DepartmentEntity departmentEntity){
        departmentMapper.insertSelective(departmentEntity);
    }

    public void deleteByPrimaryKey(Long id) {
        departmentMapper.deleteByPrimaryKey(id);
    }

    public DepartmentEntity selectByPrimaryKey(Long id){
        return departmentMapper.selectByPrimaryKey(id);
    }

    public void updateByPrimaryKey(DepartmentEntity departmentEntity){
        departmentMapper.updateByPrimaryKey(departmentEntity);
    }
}
